/*
Realistic Unit Modification v4.0 Dialog 
v4.0.0.1 [ALPHA]
Concept & Development by Draper & Raps | [VRC]
*/

private ["_rum1","_rum2","_rum3","_rum4","_rum5","_man","_t st","_bool"];
_man = _this select 0;
_tst = 0;

// this is a test, still needs select option definition for options, right now it just uses whats in the menu
// while {alive _man} do {
	_bool = call {"B_UAV_01_backpack_F" == typeOf unitBackpack _man || "B_recon_JTAC_F" == typeOf _man || "B_Helipilot_F" == typeOf _man || "B_sniper_F" == typeOf _man || "B_recon_LAT_F" == typeOf _man || "B_spotter_F" == typeOf _man || "B_Soldier_SL_F" == typeOf _man };
	//hint format ["%1",_bool];
	if (_bool and _tst == 0) then {
		_rum1 = _man addAction ["<img color='#006CB9' size='1.3' shadowColor='#FFFFFF'  image='a3\ui_f\data\map\Markers\NATO\b_art.paa' /><t color='#006CB9'> Artillery</t>",(RUM_PATH+"Arty\RUM_Arty.sqf"),[], -1, false, false, "", "_target == player"];
		_rum2 = _man addAction ["<img color='#006CB9' size='1.3' shadowColor='#FFFFFF' image='a3\ui_f\data\map\Markers\NATO\b_plane.paa' /><t color='#006CB9'> Fixed Wing Attack</t>",(RUM_PATH+"Fxd\RUM_Fxd.sqf"),[], -2, false, false, "", "_target == player"];
		_rum3 = _man addAction ["<img color='#006CB9' size='1.3' shadowColor='#FFFFFF' image='a3\ui_f\data\map\Markers\NATO\b_air.paa' /><t color='#006CB9'> Rotor Wing Attack</t>",(RUM_PATH+"AHel\RUM_AHel.sqf"),[], -3, false, false, "", "_target == player"];
		_rum4 = _man addAction ["<img color='#006CB9' size='1.3' shadowColor='#FFFFFF' image='a3\ui_f\data\map\Markers\NATO\b_air.paa' /><t color='#006CB9'> Rotor Wing Transport</t>",(RUM_PATH+"Transport\RUM_THel.sqf"),[], -4, false, false, "", "_target == player"];
		_rum5 = _man addAction ["<img color='#006CB9' size='1.3' shadowColor='#FFFFFF' image='a3\ui_f\data\map\Markers\NATO\b_support.paa' /><t color='#006CB9'> Logistics</t>",(RUM_PATH+"Supply\RUM_SUP.sqf"),[], -5, false, false, "", "_target == player"];

		_tst = 1;
	};
	if (!_bool and _tst == 1) then {
		_tst = 0;
		_man removeAction _rum1;
		_man removeAction _rum2;
		_man removeAction _rum3;
		_man removeAction _rum4;
		_man removeAction _rum5;
	};
	// sleep 1;
// };

// waitUntil{
	// sleep 0.5;
	// !alive _man;
// };
// waitUntil{
	// sleep 0.5;
	// alive _man;
// };

// if (true) exitWith {
	// [_this] execVM "RUM\Common\useRadio.sqf";
// }; 